lpr is used to print Macintosh files by sending them to a remote lpd daemon. The files may be preformatted, formatted on the Mac, or formatted by lpd. In addition to the normal features of lpr, this version includes special provisions for formatting Pascal files and for printing on IBM VM systems running LPDSERVE, which is available from Columbia University.
System Requirements
lpr may be used on any Macintosh which can be configured to use MacTCP. Use of lpr requires access to a host running an lpd daemon.
Configuration
No configuration of lpr is required, since lpr obtains network configuration information from MacTCP. As an option, default host and printer names may be configured for lpr. These are the names that appear in the ╥Destination╔╙ settings dialog. They are configured by adding string resources to lpr using ResEdit or a similar program. Each resource should be numbered 0, and have the preload attribute set. For the host name, add a string resource of type ╥hnam╙; for the printer name use a resource type of ╥hprt╙.
Starting lpr
To start lpr, double-click on the program or on one of its settings files (settings files have a document icon similar to the program's icon). If no settings file is selected, lpr will allow you to select one using a standard file dialog. After that, there will be a brief pause while lpr initializes its network connection. When lpr displays its status window it is ready to use.
Specifying a Host Name
In many cases, after starting lpr, it will be necessary to specify a host name. Valid host names are:
1. A name which can be resolved by a domain name server. To use this option, MacTCP must be properly configured to perform domain name resolution.
2. A full Internet number, such as 128.148.128.42.
Miscellaneous Notes
MultiFinder and Memory Requirements
lpr may be run in the foreground or in the background under MultiFinder. If necessary, more than one copy of lpr may be run at the same time. Note, however, that some hosts may not support more than one lpr connection at a time. The ╥About lpr╔╙ dialog box includes the amount of available memory. This should be at least 30K to ensure that sufficient memory is available.
Pascal Formatting
Selecting Pascal formatting in the ╥Formatting╔╙ dialog causes lpr to interpret certain Pascal comments as formatting commands. The comments which are recognized are:
{EJECT}
{TITLE titletext}
Both commands cause a new page to be started. In addition, ╥TITLE╙ causes the specified text to replace the second top title line. These command may be preceded or followed by any number of blanks or tabs, but no other characters may appear on the same line.
Setting the Port Number
lpr connects to the host using the standard port for lpd, 515. However, a different port number can be specified by appending it to the host name, separated by a colon. For example:
brownvm.brown.edu:555
Printing Lists of Files
The ╥Print list of files╔╙ item in the ╥File╙ menu may be used to print a group of files together. The group of files will be sent to the host as one logical file. To use this option, prepare a text file which lists the names of the files to be printed, one file name per line. The list file and all the files it names must be located in the same folder.
VM Printer Considerations
The check box ╥IBM VM Printer╙ in the ╥Destination╔╙ settings modifies the behavior of lpr in two ways:
1. A userid and password must be specified in the Print File Destination dialog before printing will begin. Using an extension to the lpr protocol, lpr will send the userid and password to the host for verification. In order to protect the user, the userid and password will expire if there is no printing activity for at least three minutes. Once the userid and password expire, they must be re-entered before printing can continue.
2. The ╥Printer Control╔╙ settings dialog is expanded to allow specification of the class and form for the print file. The VM lpd server will use these class and form settings for the print file it creates.
Protocol Considerations
The Print File Destination dialog contains a check box labelled ╥New Protocol╙. When this box is checked, lpr sends the print file information to the lpd daemon in a slightly different format. This format is required by some new implementations of lpd. If printing fails because files are being rejected by lpd, it may be necessary to select the ╥New Protocol╙ option in order for the files to be printed.
Duplex Formatting
The ╥Formatting╔╙ dialog contains a check box labelled ╥Duplex printing╙. When this option is selected, lpr will add an extra blank page to each file it prints which has an odd number of pages. This option is most useful when printing a list of files on a duplex printer. In that case this option ensures that each file will start on a new sheet of paper.
Supressing Form Feeds
The ╥Formatting╔╙ dialog contains a check box labelled ╥Suppress form feeds between files╙. This option affects how lpr prints a list of files when formatting is not being done on the Macintosh. Normally, lpr inserts a form feed between each file to ensure that each file starts at the top of a new page. However, when this option is selected lpr omits the form feeds. The files print concatenated together, as if they were a single large file.
Reporting Problems
Please report any problems to the author:
Peter DiCamillo
Computing and Information Services
Brown University
P.O. Box 1885
Providence, RI 02912
(401) 863-7582
Internet: cmsmaint@Brownvm.Brown.Edu
BITNET: CMSMAINT@BROWNVM
Compuserve: 73577,2036
BIX: pjdicamillo
AppleLink: A0216
Generating Debugging Information
To aid in reporting problems, lpr includes the ability to create a debugging file. The file is written using the name ╥ram:tcpdebug╙, i.e. a file named ╥tcpdebug╙ is written to the volume named ╥ram╙. If a volume named ╥ram╙ does not exist, the file will not be written. As the name suggests, it is generally best to use a ram disk for the debugging file, since writing to a ram disk will not significantly affect the timing of events in the program.
The contents of the debugging file is determined by the current debugging level. The level defaults to 0, which means no file will be written. To change the level, manually add a new line to the settings file you are using. For example, to set the level to 3, add the line:
debug=3
Rember to set the creator and type of the settings file to ╥lpra╙ and ╥lprp╙ if they were changed by editting it. The following levels of debugging are defined:
level 1:
basic debugging: initialization information, negotiation information, and a record of each TCP/IP event received.
level 2:
level 1 information, plus application data sent and received.
level 3:
level 2 information, plus TCP/IP data sent and received.
level 99:
same as level 3, except the debugging information is sent out the modem port at 9600 baud.
Except for 99, setting the level greater than 3 is the same as using 3. The debug level will be preserved if the settings are subsequently saved.